using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using BA.DAL;
using Microsoft.VisualBasic;

namespace BlazeApps.Library.Forum
{
    public class TopicList : Base
    {
        private BA.DAL.DBUtility DAL = new BA.DAL.DBUtility();
        private Procedures Procs = new Procedures();

        public DataTable GetTopics()
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            return DAL.GetDataTable(Procs.ListForumTopic.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

		public DataTable GetActiveTopics()
		{
			DAL.CreateDBObjects(ConnectionString, Provider);

			return DAL.GetDataTable(Procs.ListActiveTopics.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
		}

        public DataTable GetTopics(Guid ForumID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("ForumID", ForumID);

            return DAL.GetDataTable(Procs.ListForumTopicByForumID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetBreadCrumbLinks(Guid TopicID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@TopicID", TopicID);

            return DAL.GetDataTable(Procs.ListLinkDataForTopicByTopicID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetTopicEmailDetails(Guid TopicID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@TopicID", TopicID);

            return DAL.GetDataTable(Procs.ListTopicEmailByTopicID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }
    }
}
